package cn.itcast.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**控制器类
 * @author Honglixi
 * @create 2021-03-19 13:17
 */
//控制器类
    //Spring就能找到Controller类，通过@RequestMapping注解处理对应的请求。
@Controller
@RequestMapping(path = "/user")
public class HelloController {
    @RequestMapping(path = "/hello")
    public String sayHello(){
        System.out.println("Hello StringMVC");
        return "success";
    }

    /**
     * RequestMapping注解
     * @return
     */
   @RequestMapping(path = "/testRequestMapping",method = {RequestMethod.GET},params = {"username"},headers = {"Accept"})
    public String testRequestMapping(){
        System.out.println("测试RequestMapping注解。。。");
        return "success";
    }
}
